<?php
class IndexAction extends Action{
    
	function _initialize(){
    	//parent::_initialize();
		//临时验证是否使用该模块
		if(true){
			$tempverify = $_REQUEST['tempverify'];
			if(empty($tempverify))$tempverify=$_SESSION['plugininfo']['tempverify'];
			if($tempverify!='yes'){
				$this->error('暂时未开放该功能');
			}
			$_SESSION['plugininfo']['tempverify']=$tempverify;
		}
    }
	
    public function index(){
    	$new_agents = model('Agent')->selectAgents(5);
    	$this->assign('new_agents',$new_agents);
    	$this->display();
    }
    
    public function testplugin(){
		$plugin_htmlcode = strtr($_REQUEST['plugin_htmlcode'],array('\\"'=>'"')); 
		
		$this->assign('plugin_htmlcode',$plugin_htmlcode);
    	$this->display();
    }
    
	public function agreement(){
		$sortcode = $_GET['sortcode'];
		$docdata = service('Common')->getDocBySortCode($sortcode);
		$this->assign('docdata', $docdata);
		$this->display();
	}
	
	public function help(){
		$sortcode = $_GET['sortcode'];
		$docs = service('Common')->getSubDocBySortCode('doc_agent');
		$helpdoc = service('Common')->getDocBySortCode($sortcode);
		$this->assign('helpdoc', $helpdoc);
		$this->assign('docs', $docs);
		$this->display();
	}
}
?>